package com.wechat.scheme.handler;

import com.wechat.scheme.builder.TextBuilder;
import com.wechat.scheme.repo.BaiduSourceRepo;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType;


@Slf4j
@Component
public class MsgFileHandler extends AbstractHandler {



    private static final String temple_str = "抱歉,-_-暂时不支持文件识别,功能开发ing";


    @Override
    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
                                    Map<String, Object> context, WxMpService weixinService,
                                    WxSessionManager sessionManager) {

        if (!wxMessage.getMsgType().equals(XmlMsgType.EVENT)) {
            //TODO 可以选择将消息保存到本地
        }
        String respContent = "未知的消息类型！";
        respContent = temple_str;
        return new TextBuilder().build(respContent, wxMessage, weixinService);
    }

}
